using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SampleDropDown : MonoBehaviour
{
    public FPButton fPButton;
    public GameObject myDropDown;

    public FPButton fpItem1;
    public FPButton fpItem2;
    public FPButton fpItem3;

    public Text text;

    private void Awake()
    {
        fPButton = GetComponent<FPButton>();
    }

    // Start is called before the first frame update
    void Start()
    {
        fPButton.onClick.AddListener(() =>
        {
            myDropDown.SetActive(true);
        });
        fpItem1.onClick.AddListener(() =>
        {
            fpItem1.transform.parent.gameObject.SetActive(false);
            text.text = fpItem1.GetComponentInChildren<Text>().text;
        });
        fpItem2.onClick.AddListener(() =>
        {
            fpItem2.transform.parent.gameObject.SetActive(false);
            text.text = fpItem2.GetComponentInChildren<Text>().text;
        });
        fpItem3.onClick.AddListener(() =>
        {
            fpItem3.transform.parent.gameObject.SetActive(false);
            text.text = fpItem3.GetComponentInChildren<Text>().text;
        });
    }

    // Update is called once per frame
    void Update() { }
}
